//
//  BHJsonSwitch.m
//  xinlangweibo0621
//
//  Created by boldseas on 2017/6/26.
//  Copyright © 2017年 renbohan. All rights reserved.
//

#import "BHJsonSwitch.h"

@implementation BHJsonSwitch

+ (NSDictionary *)dictionaryWithJsonString:(NSString *)jsonString{
    if (jsonString == nil) {
        return nil;
    }
    NSLog(@"%@", jsonString);
    
    NSData *jsonData = [jsonString dataUsingEncoding:NSUTF8StringEncoding];
    NSError *err;
    
    NSDictionary *dict = [NSJSONSerialization JSONObjectWithData:jsonData options:0 error:NULL];
    
    if (err) {
        NSLog(@"json--解析失败: %@", err);
        return nil;
    }
    return dict;
}

@end
